Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Fix】: alt-text string null determination #1013

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taku10101
Copy link

closed #971

@taku10101 taku10101 changed the title 【Fix】: string null determination 【Fix】: alt-text string null determination Oct 6, 2024
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need some tests to show what bug is being fixed.

@@ -39,7 +39,7 @@ const ariaLabelHasValue = (prop) => {
if (value === undefined) {
return false;
}
if (typeof value === 'string' && value.length === 0) {
if (typeof value === 'string' && value.length === 0 && value === '') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value === '' and value.length === 0, when it's already a string, are the same condition.

Suggested change
if (typeof value === 'string' && value.length === 0 && value === '') {
if (typeof value === 'string' && value.length === 0) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

alt-text: missing warning for empty alt for <input type="image" alt="" />
2 participants